<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 100px;
            border: 1px solid #000;
            margin: 10px;
        }

        /* 渐变一定要写在背景中 */
        /*
        浏览器前缀： 
        -webkit- 谷歌
        -moz-    火狐
        -ms-     ie
        -o-      欧朋
        */
        /* 渐变色 在ie9 及以下，即使写了前缀也不会有效果 */
        div:nth-of-type(1) {
            background: -ms-linear-gradient(top, pink, blue);
            background: -webkit-linear-gradient(top, pink, blue);
        }

        div:nth-of-type(2) {
            background: -webkit-linear-gradient(left top, pink, blue);
        }

        div:nth-of-type(3) {
            background: -webkit-repeating-linear-gradient(left, pink 0, blue 50px);
        }

        div:nth-of-type(4) {
            background: -webkit-repeating-linear-gradient(left, pink 0, blue 10%, green 25%, red 50%, yellow 100%);
        }

        div:nth-of-type(5) {
            background: -webkit-repeating-linear-gradient(left, pink 0, blue 50px, green 100px, red 150px, yellow 200px);
        }

        div:nth-of-type(6) {
            background: -webkit-repeating-linear-gradient(left, pink 0, blue 50px, green 50px, green 150px, yellow 150px, yellow 200px);
        }
    </style>
</head>

<body>
    1.基础渐变
    <div></div>
    2.规定了起始位置
    <div></div>
    3.循环效果
    <div></div>
    4.多点渐变
    <div></div>
    5.使用 px值
    <div></div>
    6.跳变效果
    <div></div>
    7.电视节目的彩条效果 --作业
    <div></div>
</body>

</html>